import request from '@/config/axios'

export interface EleScaleVO {
  id: number,
  name: string,
  ip: string,
  port: number,
  status: number
}

// export interface EleScaleVO2 {
//   id: number,
//   status: number
// }

// 查询电子秤列表
export const getElectronicScale = (params: PageParam) => {
  return request.get({ url: '/project/electronic-scale-manage/page', params })
}

// 查询电子秤详情
export const getEleScaleDetail = (id: number) => {
  return request.get({ url: '/project/electronic-scale-manage/get?id=' + id })
}

// 新增
export const createElectronicScale = (data: EleScaleVO) => {
  return request.post({ url: '/project/electronic-scale-manage/create', data })
}

// 更新
export const updateElectronicScale = (data: EleScaleVO) => {
  return request.put({ url: '/project/electronic-scale-manage/update', data })
}

// 修改状态
export const changeStatus = (data) => {
  return request.post({ url: '/project/electronic-scale-manage/updateStatus', data })
}
// 状态修改
export const updateUserStatus = (id: number, status: number) => {
  const data = {
    id,
    status
  }
  return request.post({ url: '/project/electronic-scale-manage/updateStatus', data: data })
}
